<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/8/11
 * Time: 15:56
 */
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\widgets\Datetimepicker;
use yii\helpers\Html;
use common\components\helpers\Fun;

LayerConfirmWidget::widget();
LayerIframeWidget::widget();
Datetimepicker::widget();

?>

<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <?= Html::beginForm(Fun::url(['consumption/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
        <?= \common\components\helpers\Search::dropDownList('mechanic_id', null, array_merge([null => '请选择'], $listData), ['label' => '机构名称', 'promote' => '请选择', 'class' => 'search diy_select_txt']) ?>
        <?= \common\components\helpers\Search::textInput('searchDate', null, ['label' => '消费日期', 'class' => 'search datetimepicker yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::dropDownList('searchWay', null, [null => '请选择', '1' => '按月', '2' => '按日'], ['label' => '按月按日', 'promote' => '请选择', 'class' => 'search diy_select_txt']) ?>
        <?= \common\components\helpers\Search::dropDownList('ordersType', null, [null => '请选择', '1' => '预约', '2' => '退定金', '3' => '退课', '4' => '消费'], ['label' => '订单类型', 'promote' => '请选择', 'class' => 'search diy_select_txt']) ?>
        <?= \common\components\helpers\Search::textInput('tel', null, ['label' => '手机号', 'class' => 'search yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::textInput('name', null, ['label' => '会员名称', 'class' => 'search yx-width150 zx-lh24 yx-ml6']); ?>
        <?= \common\components\helpers\Search::submitButton('搜索', ['id' => 'search-handle', 'class' => "yx-search yx-radius2"]); ?>
        <?php Html::endForm() ?>
        <div class="yx-clear"></div>
    </div>
    <div id="data_totals" class="zx-mg"><?= $content ?></div>
    <div class="docs-main zx-mg">
        <table id="tablesaw" class="tablesaw table yx-table1 yx-table5 table-striped with-check"
               data-tablesaw-mode="swipe" data-tablesaw-minimap>
            <thead>
            <tr class="yx-bgd2f6ec">
                <th><?= \Yii::t('zhtfrontend', 'ID'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '订单编号'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '姓名'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '手机号'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '优惠金额'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '订单时间'); ?></th>
                <th class="yx-br"><?= \Yii::t('zhtfrontend', '消费金额'); ?></th>
            </tr>
            </thead>
            <?php if ($data): ?>
                <?php foreach ($data as $item): ?>
                    <tr data-id="<?= $item['id'] ?>">
                        <td><?= $item['id'] ?></td>
                        <td><?= $item['sn'] ?></td>
                        <td><?= $item['customer_name'] ?></td>
                        <td><?= $item['telephone'] ?></td>
                        <td><?= $item['discount_amount'] ?></td>
                        <td><?= $item['created_at'] ?></td>
                        <td><?= $item['remain_amount'] ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </table>
        <div style="text-align: right"><?= common\components\widgets\GoPager::widget(['pagination' => $pages]) ?></div>
    </div>
</div>



